home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-07 | 4.4 KB | 117 lines | [TEXT/MPS ] |
- ; File MacRuntime.a
- ;
- ; Copyright Apple Computer, Inc. 1994-1996
- ; All rights reserved.
- ;
- ; Include File for Accessing the MacRuntime Libraries
-
- ; Set CASE OBJECT to assure references to the names IMPORTed here link
- ; properly. The following statements restore the CASE setting to its
- ; previous value.
-
- IF &TYPE('__INCLUDINGMACRUNTIME__') = 'UNDEFINED' THEN
- __INCLUDINGMACRUNTIME__ SET 1
-
- IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
- include 'ConditionalMacros.a'
- ENDIF
-
- IF GENERATING68K THEN
-
- PRINT Push,Off ; save current print settings and turn it off
- GBLC &S%%%,&P%%%
- &S%%% SETC &Setting('CASE') ; save current CASE setting
- &P%%% SETC &Setting('PRINT',1) ; and PRINT settings before we changed them
-
- MACRO
- X%%%
- GBLC &S%%%,&P%%% ; link references with previously defined variables
- PRINT Push,&P%%% ; restore the previous PRINT settings
- CASE &S%%% ; and restore the CASE setting
- PRINT POP ; restore the PRINT settings
- ENDM
-
- PRINT Pop ; restore the PRINT settings
- CASE OBJECT ; all imported/exported names case significant
-
- ; MacRuntime Globals
-
- IMPORT MacOSErr ; 0 if no error, error value otherwise
- ; added from errors.a • rjd 941017
-
- IMPORT StandAlone ; a long, 0 if in shell, 1 if standalone
-
- IF (&TYPE('NURUNTIME') <> 'UNDEFINED') THEN
- _#StandAlone DS.L StandAlone
- ENDIF
-
- ; MacRuntime Utility Routines
-
- ;** pascal Boolean TrapAvailable (short TrapNumber);
-
- IMPORT TRAPAVAILABLE ; Determine if a Trap is available
-
-
-
- ; 68K CFM Runtime and Shared Library Support Routines
- ;
- ; ****
- ; NOTE: These Support Routines were made obsolete for E.T.O. #16 • rjd 941017
- ; ****
- ;
- ; NOTE: To use these routines, you must define the symbol 'NURUNTIME' at
- ; assembly time.
- ;
- ; IF (&TYPE('NURUNTIME') <> 'UNDEFINED') THEN
- ;
- ;** LinkupQDGlobals is called from the default CFM init routine %__INIT.
- ;** Please Refer to FragLoad.h for the prototype of custom init routines.
- ;** If you create your own init routine you must call LinkupQDGlobals before
- ;** any other code you write (and that code MAY NOT call Quickdraw)
- ;**
- ;** LinkupQDGlobals purpose is to create a linked list of all the "per context"
- ;** A5 Worlds in a given application context so that QuickDraw will find a
- ;** "QD globals" pointer at A5+0 no matter which A5World is currently ref'd by A5.
- ;**
- ;** The linked list built by LinkupQDGlobals uses the lomem global CurrentA5
- ;** and builds the list thru the qd Globals pointers at A5+0, IF InitGraf() has
- ;** NOT yet been called; Otherwise LinkupQDGlobals just copies the value of the
- ;** QuickDraw globals pointer (at the location pointed to by CurrentA5) into
- ;** the A5+0; i.e. into the A5World of the code fragment containing LinkupQDGlobals.
- ;**
- ;** LinkupQDGlobals is and MUST REMAIN a staticly linked routine, called by the
- ;** init routine of each separate code fragment. It may not be exported or shared.
- ;**
- ;** LinkupQDGlobals will only return an error if it is called and the A5World
- ;** referenced by the lomem pointer CurrentA5 is NOT a NuRuntime A5World AND
- ;** QuickDraw has NOT been initialized. This condition can occur ONLY if an
- ;** "old"/"Classic" 68K model application is attempting to use the CFM API directly.
- ;**
- ;** The routine BindQDGlobalsList must be called IMMEDIATELY before the application
- ;** initialization call of QuickDraw's InitGraf() routine, WITH THE SAME parameter
- ;** passed to InitGraf. BindQDGlobalsList resolves the linked list of A5Worlds
- ;** created by LinkupQDGlobals. This will cause all the A5Worlds to have a valid
- ;** pointer at A5+0 to the same QuickDraw Globals.
- ;**
- ;** Shared Libraries that have "Global" sharing (i.e 1 copy of data in system heap)
- ;** must have customized Init Routines and probably will require a private copy of
- ;** the quickdraw globals that are created manually and A5+0 initialized without
- ;** calling QuickDraw's InitGraf() IF such libraries are to call QuickDraw (directly
- ;** or indirectly) at all. The most likely case of a "data only" globally shared
- ;** fragment will not need to have an init routine that fixes up A5+0, since no code
- ;** will ever execute with A5 referencing its A5World.
- ;**
- ;** pascal OSErr LinkupQDGlobals(void);
- ;** pascal void BindQDGlobalsList(void* globalPtr);
- ;**
- ;
- ; IMPORT LINKUPQDGLOBALS
- ; IMPORT BINDQDGLOBALSLIST
- ;
-
- ELSE
- aerror 'MacRuntime.a is a 68K only assembly file!'
- ENDIF ; ...GENERATING68K
-
- ENDIF
-